package com.snail.service.impl;

import com.snail.mapper.BizCartItemMapper;
import com.snail.model.vo.cart.CartItemGroupBySellerVO;
import com.snail.service.BizCartItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BizCartItemServiceImpl implements BizCartItemService {
    @Autowired
    private BizCartItemMapper bizCartItemMapper;
    @Override
    public void deleteByCartIdAndProductId(Integer cartId, Integer productId) {
        bizCartItemMapper.deleteByCartIdAndProductId(cartId, productId);
    }

    @Override
    public void deleteByCartId(Integer cartId) {
        bizCartItemMapper.deleteByCartId(cartId);
    }

    @Override
    public List<CartItemGroupBySellerVO> listCartItemGroupBySeller(Long userId) {
        List<CartItemGroupBySellerVO> cartItemGroupBySellerVOS = bizCartItemMapper.listCartItemGroupBySeller(userId);
        //遍历集合，把
        return cartItemGroupBySellerVOS;
    }
}
